import axios from "../utils/request.js" //引入封装好的axios
import base from "./base.js" //引入接口域名列表

const api={
    login(params){
       return axios.post(base.baseUrl+base.login,params)
        },
    logout(){
        return axios.get(base.baseUrl+base.logout,params)
    },
    test(params){
        return axios.get(base.baseUrl+base.test,params)
    },
    get_menus(params){
        return axios.get(base.baseUrl+base.get_menu,params)
    },
    get_users(params){
        return axios.get(base.baseUrl+base.get_users,params)
    },
    add_user(params){
        return axios.post(base.baseUrl+base.get_users,params)
    },
    get_user_by_id(id){
        return axios.get(base.baseUrl+base.get_user_by_id+id)
    },
    edit_user(id,params){
        return axios.put(base.baseUrl+base.edit_user+id,params)
    },
    delete_user(id){
        return axios.delete(base.baseUrl+base.delete_user+id)
    },
    reset_user_password(id){
        return axios.get(base.baseUrl+base.reset_user_password+id)
    }
}
export default api